<!DOCTYPE html>

<html>

<head>
    <meta charset="utf-8">
    <title>测试接口列表</title>
    <script type="text/javascript" src="http://www.seksxy.com/hr_ghtg/js/jquery-1.8.2.min.js"></script>
</head>

<body style="text-align:center;">

    <input type="button" onclick="" value="测试" onclick="" />
</body>

</html>

<script>
    $(function () {
        //添加医生排班
        //addsheduling();

        patientlist();
        //saveregistrationinfor();
        //copyall();
        //removeusers();
        //修改排班时间
        //listsheduling();
        //修改排班科室
        //updepartment();
        //排版列表
        //shedulingcreate();
    });


    function saveregistrationinfor() {
        $.post('http://localhost:3000/registrationinfor/save', {
            receptiontime: '2018/3/14 20:00:00',//接诊时间
            receptionstate: 0,//接诊状态  0:待接诊   1:接诊中   2:待分诊
            receptiontype: 0,//接诊类型   0:初诊   1:复诊
            department: "心理科",//科室
            doctor: "张三",//医生
            registerpeople: '笑了',//登记人员
            registrationlv: 1,//挂号等级
            registrationmoney: 50,//挂号费用
            paystate: 1,//支付状态
            payer:"5aa8ca6b53e66334947f5caa",
        }, function (result) {
                return result;
            });
    }

    function createrefundorder() {
        $.post('http://localhost:3000/refund/save', {
            orderid: '1'
        }, function (result) {
            return result;
        });
    }

    //查询订单
    function selectorder() {
        let pageindex = 1;//页码
        let pagesize = 9;//每页显示数据条数 
        let state = 1;//   支付状态 1:待收费    2:已收费   3:已退费
        let starttime = '2018/2/28 00:30';// 2018/2/28 14:30
        let endtime = '2018/2/28 23:30';;
        let searchtxt = req.query.searchtxt;

    }
    //创建订单
    function createorder() {
        $.post('http://localhost:3000/order/save', {
            orderid: '1'
        }, function (result) {
            return result;
        });
    }

    //复制上周排班信息
    function copyall() {
        let a = [{ id: '5a7fba3f6571843fc8ab0df5' }, { id: '5a7fb7a0a2f2c01354713d18' }];
        $.post('http://localhost:3000/doctor/copyallscheduling', {
            id: a,
            time: '2018/2/26'
        }, function (result) {
            return result;
        });
    }
    //添加人员信息
    function addusers() {
        $.post('http://localhost:3000/doctor/save', {
            name: '123',
            sex: ''
        }, function (result) {
            return result;
        });
    }
    //删除人员信息
    function removeusers() {
        $.post('http://localhost:3000/doctor/delete', {
            id: '5a8fbdcd0aa1f61c4d656b63'
        }, function (result) {
            return result;
        });
    }

    function patientlist() {
        var data = {
            starttime: '2018-03-17 00:00:00',
            endtime: '2018-03-17 23:59:59',
        };
        $.post('http://localhost:3000/patient/list', {
            starttime: '2018-03-17 00:00:00',
            endtime: '2018-03-17 23:59:59'
        }, function (result) {
            return result;
        });
    }

    /**
     * 医生排班接口
     * const starttime = req.body.starttime;//排班列表开始日期
        const endtime = req.body.endtime;//排班列表结束日期
        const department = req.body.department;//科室
        const time = req.body.time;//排班时间
        const name = req.body.name;//排班名称
        const id = req.body.id;//医生ID
    */

    //修改排班时间
    function listsheduling() {
        $.post('http://localhost:3000/doctor/updateclasses', {
            time: '2018/2/7',
            name: 'wan班',
            id: '5a7d559881c2231c73201a1a'
        }, function (result) {
            return result;
        });
    }

    //修改排班科室
    function updepartment() {
        $.post('http://localhost:3000/doctor/updatedepartment', {
            id: '123456',
            department: 'ssr科'
        }, function (result) {
            return result;
        });
    }
    //添加医生排班信息
    function addsheduling() {
        $.post('http://localhost:3000/doctor/addarrangemes', {
            id: '123456',
            name: '小冷',
            department: '全科',
            arrangemes: '',
            yearmonthday: '2018.02.02'
        }, function (result) {
            return result;
        });
    }

    //排版列表
    function shedulingcreate() {
        $.post('http://localhost:3000/doctor/listscheduling', {
            starttime: '2018-1-01',
            endtime: '2019-1-01',
            pageindex: 1,
            pagesize: 3
        }, function (result) {
            return result;
        });
    }

    function registrationlist() {
        $.post('http://localhost:3000/registration/list', {}, function (result) {
            return result;
        });
    }
</script>